# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-ptrace
_pkgname=python-ptrace
pkgver=1.0.1
pkgrel=1
pkgdesc='Python binding of ptrace.'
url='https://pypi.org/project/python-ptrace/#files'
arch=('any')
license=('GPL2')
depends=('python2' 'python2-six')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('d33a75042bf2c4fd873211be9fa43ac2abc15c706664ed2b74f250a33f591d7998064d90de2b7d83fb57c69c9465a0a543ca35212fcb8295595560533e3ad962')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  for i in "$pkgdir/usr/bin/"*; do
    mv $i "${i}2"
  done
}

